import React from 'react'
import {Image, Text, TouchableOpacity, View,} from 'react-native'
import PageView from "../Component/Common/PageView";


import BasePage from '../BasePage'
import NavigationBar from 'teaset/components/NavigationBar/NavigationBar';

export default class HousekeeperPage extends BasePage {


    constructor(props) {
        super(props);
        this.state = {
            ...this.state,

            isshow: false

        };

    }

    renderNavigationBar() {
        return (
            <NavigationBar
                style={{backgroundColor: 'white',}}

                title={
                    <View style={{
                        flexDirection: 'row',
                        justifyContent: 'center',
                        alignSelf: 'center',

                    }}>
                        <Text style={{
                            fontSize: 20,
                            color: '#333333'
                        }}>管家</Text>
                    </View>}

                leftView={<TouchableOpacity
                    onPress={() => {


                        this.navigator.pop();


                        // DeviceEventEmitter.emit('my', {text: '刷新'})

                    }}
                >
                    <Image style={{width: 15, height: 15, marginLeft: 20}} source={require('../images/btn_back.png')}/>

                </TouchableOpacity>}

            />

        );
    }

    componentWillMount() {


        this.showLoad(true)
        setTimeout(this.openApp.bind(this), 2000);
    }

    openApp() {
        this.showLoad(false)

        this.setState({
            isshow: true
        })
    }

    renderPage() {
        return (

            <PageView style={{
                flex: 1
            }} hiddenNav={true} fromPage={this} {...this.state}>
                {
                    this.state.isshow ?
                        <View style={{
                            flex: 1, justifyContent: 'center', flexDirection: 'column',
                            alignItems: 'center', backgroundColor: '#eeeeee'
                        }}>

                            <Image style={{width: 60, height: 60,}} source={require('../images/nodata.png')}/>
                            <Text style={{
                                fontSize: 16,
                                marginTop: 13
                            }}>没有内容请添加设备</Text>
                        </View>

                        : null
                }

            </PageView>
        );
    }
}